import test from "@/uni_modules/uview-plus/libs/function/test";
const base = {
	mapKey: "IIOBZ-WKNLV-PPPP7-57OSU-URGBF-N4FGF", // 客户端地图key
	workerMapKey: "TSRBZ-3E4LB-TU3U2-NDPDM-53NX6-EAFCK", // 阿姨端地图key
	MainColor: "#00adad",
	toast(param) {
		param = param || {};
		const {
			msg = param,
				time = 1500,
				icon = "none",
				position = "center",
				mask = true,
				success,
				fail,
				complete,
		} = param;
		const type = typeof msg;
		const title = ["string", "number"].includes(type) ? msg.toString() : "";
		uni.showToast({
			duration: time,
			icon: test.empty(icon) ? "none" : icon,
			mask: true,
			title,
			position,
			success,
			fail,
			complete,
		});
	},
	loadToast(msg) {
		uni.showLoading({
			title: test.empty(msg) ? "加载中..." : msg,
			mask: true,
		});
	},
};

export default base;